Re: Add column if not exists (CINE)

Поиск
Список
Период
Сортировка
От Bernd Helmle
Тема Re: Add column if not exists (CINE)
Дата
Msg-id 98E1925E9A11BF88B48E1E23@[80.156.86.78]
обсуждение исходный текст
Ответ на Re: Add column if not exists (CINE)  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers

--On 1. Mai 2010 23:09:23 -0400 Robert Haas <robertmhaas@gmail.com> wrote:

> On Wed, Apr 28, 2010 at 9:15 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>> CREATE OR REPLACE is indeed much more complicated.  In fact, for
>>> tables, I maintain that you'll need to link with -ldwim to make it
>>> work properly.
>>
>> This may in fact be an appropriate way to handle the case for tables,
>> given the complexity of their definitions.
>
> Patch attached.
>


I had an initial look at Robert's patch. Patch applies cleanly,
documentation and regression tests included, everything works as expected.
When looking at the functionality there's one thing that strikes me a
little:

bernd@localhost:bernd #*= CREATE TABLE IF NOT EXISTS foo(id int);
ERROR:  duplicate key value violates unique constraint
"pg_type_typname_nsp_index"
DETAIL:  Key (typname, typnamespace)=(foo, 2200) already exists.

This is what you get from concurrent CINE commands. The typname thingie
might be confusing by unexperienced users, but i think its hard to do
anything about it ?




--
Thanks
Bernd


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: patch: to_string, to_array functions
Следующее
От: Markus Wanner
Дата:
Сообщение: Re: dynamically allocating chunks from shared memory